package com.ase.singleton.solution;

/**
 * @author gyhstart
 * @create 2021/3/6 - 22:49
 * 斐波那契数列
 * 递归
 **/
public class Solution2 {

    public static void main(String[] args) {
        System.out.println("fibonacci(10) = " + fibonacci(10));
    }

    public static int fibonacci(int number){
        if ((number == 0 )|| (number ==1)){
            return number;
        }
        return fibonacci(number-1) + fibonacci(number-2);
    }
}
